/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef __LIB2D_OBJECTS_TEXTSPRITE_H__
#define __LIB2D_OBJECTS_TEXTSPRITE_H__

#include "TextSpriteRep.h"

namespace liba
{
namespace lib2d
{
namespace objects
{

class TextSprite : private Shared< filesystem::String, TextSpriteRep >
{
public:
	explicit TextSprite( const filesystem::String & name )
	{
		load_rep( name );
	}

	double get_height()const
	{
		//TODO
		return get_rep()->get_font()->get_height();
	}

	void change_text(const WString & text)
	{
		this->text = text;
	}

	double calculate_width( const WString & text )const;

	void render( hard::Renderer * rend, const Vector2 & dst );

private:
	WString text;
};

} //namespace objects
} //namespace lib2d
} //namespace liba

using namespace liba;

#endif //__LIB2D_OBJECTS_TEXTSPRITE_H__

